package com.ecnu.sei.app.course;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.ecnu.sei.app.resources.Classroom;
import com.ecnu.sei.app.teacher.ITeacher;
import com.ecnu.sei.app.util.Utils.CollegeYear;
import com.ecnu.sei.app.util.Utils.DayHour;

public class CourseInfo {
  private String courseId = null;
  private String className = null; // e.g. 0903 
  private String courseName = null;
  private CollegeYear collegeYear = CollegeYear.FRESHMAN;
  private ITeacher teacher = null;  
  private int dayOfWeek = 0;
  private DayHour dayHour = DayHour.NONE; 
  private int studentNum = 0;
  private Classroom classroom = null;
  private ExamInfo examInfo = new ExamInfo();

  private final Logger LOG = LoggerFactory.getLogger(CourseInfo.class);

  public CourseInfo() {
  }
  
  public CourseInfo(String courseId, String courseName, String className,
      ITeacher teacher, int dayOfWeek, DayHour dayHour,  
      int studentNum, Classroom classroom) {
    this.courseId = courseId;
    this.courseName = courseName;
    this.className = className;
    this.teacher = teacher;
    this.dayOfWeek = dayOfWeek;
    this.dayHour = dayHour;
    this.studentNum = studentNum;
    this.classroom = classroom;
  }



  public String getCourseId() {
    return courseId;
  }


  public String getCourseName() {
    return courseName;
  }

  public String getClassName() {
    return className;
  }


  public CollegeYear getCollegeYear() {
    return collegeYear;
  }



  public ITeacher getTeacher() {
    return teacher;
  }



  public int getDayOfWeek() {
    return dayOfWeek;
  }



  public DayHour getDayHour() {
    return dayHour;
  }



  public int getStudentNum() {
    return studentNum;
  }



  public Classroom getClassroom() {
    return classroom;
  }



  public ExamInfo getExamInfo() {
    return examInfo;
  }



  public Logger getLOG() {
    return LOG;
  }



  public CourseInfo setCourseId(String courseId) {
    this.courseId = courseId;
    return this;
  }



  public CourseInfo setCourseName(String courseName) {
    this.courseName = courseName;
    return this;
  }



  public CourseInfo setCollegeYear(CollegeYear collegeYear) {
    this.collegeYear = collegeYear;
    return this;
  }



  public CourseInfo setTeacher(ITeacher teacher) {
    this.teacher = teacher;
    return this;
  }



  public CourseInfo setDayOfWeek(int dayOfWeek) {
    this.dayOfWeek = dayOfWeek;
    return this;
  }



  public CourseInfo setDayHour(DayHour dayHour) {
    this.dayHour = dayHour;
    return this;
  }



  public CourseInfo setStudentNum(int studentNum) {
    this.studentNum = studentNum;
    return this;
  }



  public CourseInfo setClassroom(Classroom classroom) {
    this.classroom = classroom;
    return this;
  }



  public CourseInfo setExamInfo(ExamInfo examInfo) {
    this.examInfo = examInfo;
    return this;
  }



  public void printExamInfo() {
    System.out.println("Course: " + courseName);
    System.out.println("Proctors: ");
    for (ITeacher proctor : examInfo.getProctor()) {
      System.out.println("\t" + proctor.getName());
    }
    System.out.println("Time: " + examInfo.getTime().getDate());
    System.out.println("Classroom: " + examInfo.getClassroom().getName());
    System.out.println("Patrol: " + examInfo.getPatrol().getName());
  }
}
